package com.example.pojo;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * @author lbq
 * @version 1.0
 * @date 2022/3/27 13:44
 */
public class UserAction {

    private Long userId;

    private String action;

    public UserAction() {
    }

    public UserAction(Long userId, String action) {
        this.userId = userId;
        this.action = action;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Override
    public String toString() {
        return "UserAction{" +
                "userId=" + userId +
                ", action='" + action + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (!(o instanceof UserAction)) return false;

        UserAction that = (UserAction) o;

        return new EqualsBuilder()
                .append(userId, that.userId)
                .append(action, that.action)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(userId)
                .append(action)
                .toHashCode();
    }
}
